package edu.spec.ycloud.service;

import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;

/**
 * Author       : MadFrog
 * Date         : 2018/8/20 23:41
 * Description  :
 */
public class OutboundHandler extends MqttPahoMessageHandler {
    public OutboundHandler(String clientId, MqttPahoClientFactory clientFactory) {
        super(clientId, clientFactory);
    }

    @Override
    public void messageArrived(String topic, MqttMessage message) throws Exception {
        System.out.println("messageArrived:" + topic + "," + message);
    }

    @Override
    public void deliveryComplete(IMqttDeliveryToken token) {
        System.out.println("deliveryComplete");
    }
}
